{extend name="base" /}

{block name="title"}农场参数设置{/block}

{block name="main"}
	<!-- Content Wrapper. Contains page content -->
	<div class="content-wrapper">
		<!-- Content Header (Page header) -->
		<section class="content-header">
			<h1>农场参数设置 <small>王者荣耀</small></h1>
			<ol class="breadcrumb">
				<li><a href="/shuashuale"><i class="fa fa-home"></i> 首页</a></li>
				<li class="active">农场参数设置</li>
			</ol>
		</section>

		<!-- Main content -->
		<section class="content container-fluid">
      		<div class="box box-default">
				<div class="box-header with-border">
					<h3 class="box-title">农场参数设置</h3>
				</div>
				<form method="post" role="form">
					<!-- /.box-header -->
					<div class="box-body">
						<div class="row">
							{volist name="parameters" id="parameter" key="i"}
							{if condition="($i % 2) eq 1"}
							<div class="col-md-6">
							{/if}
								<div class="form-group">
									{switch name="parameter.type"}
										{case value="1"}
										<label>{$parameter.name}</label>
										<input type="text" class="form-control" name="{$parameter.key}" value="{$parameter.value}" placeholder="{$parameter.name}">
										<span class="help-block">{$parameter.desc}</span>
										{/case}
										{case value="4"}
											{php}$values = json_decode($parameter['value'], true);{/php}
											{volist name="values" id="value" key="vi"}
											<label>第{$vi}层奖励</label>
											<input type="text" class="form-control" name="{$parameter.key}[{$vi}]" value="{$value}" placeholder="{$parameter.name}">
											<span class="help-block">{$parameter.desc}</span>
											{/volist}
										{/case}
										{case value="6"}
											<label>{$parameter.name}</label>
											<div>
												{eq name="$parameter.value" value="1"}
												<input type="radio" name="{$parameter.key}" value="1" checked>开
												<input type="radio" name="{$parameter.key}" value="0">关
												{else/}
												<input type="radio" name="{$parameter.key}" value="1">开
												<input type="radio" name="{$parameter.key}" value="0" checked>关
												{/eq}
											</div>
											<span class="help-block">{$parameter.desc}</span>
										{/case}
									{/switch}
								</div>
								<!-- /.form-group -->
							{if condition="($i % 2) eq 0"}
							</div>
							<!-- /.col -->
							{/if}
							{/volist}
						</div>
						<!-- /.row -->
					</div>
					<!-- /.box-body -->
					<div class="box-footer">
						<button type="submit" class="btn btn-primary">修改参数</button>
					</div>
				</form>
			</div>
			<!-- /.box -->
		</section>
		<!-- /.content -->
	</div>
	<!-- /.content-wrapper -->
{/block}